<html>
<head><meta charset="utf-8"><title>lldb pretty printing of slices #80214 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html">lldb pretty printing of slices #80214</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220503235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503235">(Dec 20 2020 at 05:00)</a>:</h4>
<p>Is there some way to accomplish what <a href="https://github.com/rust-lang/rust/issues/80214">#80214</a> wants or should it just be closed? I don't know enough about lldb to know whether it's feasible.</p>



<a name="220503392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503392">(Dec 20 2020 at 05:04)</a>:</h4>
<p>does llvm even interpret slices this way?</p>



<a name="220503477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503477">(Dec 20 2020 at 05:06)</a>:</h4>
<p>What do you mean?</p>



<a name="220503547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503547">(Dec 20 2020 at 05:08)</a>:</h4>
<p>what is the llvm view of a Rust fat pointer?</p>



<a name="220503563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503563">(Dec 20 2020 at 05:09)</a>:</h4>
<p>I have no clue <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="220503701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503701">(Dec 20 2020 at 05:13)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/80214#issuecomment-748563801">Apparently</a> <a href="https://users.rust-lang.org/t/debug-in-vscode-cant-show-the-slice-value/53009/10">it works with GDB</a>.</p>



<a name="220503706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503706">(Dec 20 2020 at 05:13)</a>:</h4>
<p>this is a little dated: <a href="https://michaelwoerister.github.io/2015/03/27/rust-xxdb.html">https://michaelwoerister.github.io/2015/03/27/rust-xxdb.html</a></p>



<a name="220503748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503748">(Dec 20 2020 at 05:14)</a>:</h4>
<p>"many other things work differently under the hood in Rust than in C and the debugger will balk at your trying to use these constructs, among them such fundamental things as accessing elements in a slice, accessing fields of an enum or tuple, anything that uses auto-dereferencing, or calling Rust-defined methods, functions, or closures."</p>



<a name="220503752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503752">(Dec 20 2020 at 05:15)</a>:</h4>
<p>"In order to support these crucial features, someone will have to go and directly extend the LLDB and GDB codebases."</p>



<a name="220503815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220503815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220503815">(Dec 20 2020 at 05:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="307537">Camelid</span> <a href="#narrow/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214/near/220503701">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/issues/80214#issuecomment-748563801">Apparently</a> <a href="https://users.rust-lang.org/t/debug-in-vscode-cant-show-the-slice-value/53009/10">it works with GDB</a>.</p>
</blockquote>
<p>gdb is maybe a more iterated on tool, though lldb is sometimes more <br>
convenient/useful if one is working with llvm</p>



<a name="220504195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220504195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220504195">(Dec 20 2020 at 05:28)</a>:</h4>
<p>I think we have a custom wrapper that should handle things like slices correctly; that's why it works in GDB. I guess the LLDB one doesn't work or it isn't implemented there?</p>



<a name="220504203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/220504203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#220504203">(Dec 20 2020 at 05:28)</a>:</h4>
<p>Ah, from the first paragraph of that post:</p>
<blockquote>
<p>Unbeknownst to most Rustaceans, two little helpers have found their way into almost any Rust installation over the last few months: rust-gdb and rust-lldb. These are two small wrapper scripts that will start the underlying debugger with Rust pretty printers enabled. The pretty printers are Python-based extensions that hook into the debuggers output rendering, hopefully making it easier to inspect your Rust program’s runtime state. This post will describe what rust-gdb and rust-lldb can do for you, what their limits are, and how to use them (hint: it’s easy!)</p>
</blockquote>



<a name="229410470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/lldb%20pretty%20printing%20of%20slices%20%2380214/near/229410470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/lldb.20pretty.20printing.20of.20slices.20.2380214.html#229410470">(Mar 09 2021 at 02:13)</a>:</h4>
<p>Update: OP says <a href="https://github.com/rust-lang/rust/issues/80214">#80214</a> has been fixed <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>